#ifndef EASYXUI_BOOKVECTOR_H
#define EASYXUI_BOOKVECTOR_H
#include <algorithm>
#include<cmath>
#include<time.h>
#include <cstdio>
#include <windows.h>//头文件
#include <vector>

bool is_element_in_vector(vector<int> v,int element){
    vector<int>::iterator it;
    it=find(v.begin(),v.end(),element);
    if (it!=v.end()){
        return true;
    }
    else{
        return false;
    }
}

int findPosVector(vector <int> input , int number)
{
    vector<int>::iterator iter=std::find(input.begin(),input.end(),number);//返回的是一个迭代器指针
    if(iter == input.end())
    {
        return -1;
    } else{
        return std::distance(input.begin(),iter);
    }
}

vector<int> unique_element_in_vector(vector<int> v) {
    vector<int>::iterator vector_iterator;
    sort(v.begin(), v.end());
    vector_iterator = unique(v.begin(), v.end());
    if (vector_iterator != v.end()) {
        v.erase(vector_iterator, v.end());
    }
    return v;
}


#endif //EASYXUI_BOOKVECTOR_H
